<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="showtime"></div>
    <script>
        var showtime=document.querySelector('.showtime')

        setInterval(function(){
            getdate()
        },1000)

        function getdate(){
            var tdate=new Date()
            var yy=tdate.getFullYear()
            var mm=tdate.getMonth()+1
            var dd=tdate.getDate()
            var hh=tdate.getHours()
            var ff=tdate.getMinutes()
            var ss=tdate.getSeconds()
            showtime.innerHTML=yy+"年"+mm+"月"+dd+"日"+hh+"时"+ff+"分"+ss+"秒"
        }
    </script>
</body>
</html>